package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.CompanyCustomerLableRequest;
import one.stand.response.CompanyCustomerLableResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("companyCustomerLable")
public class CompanyCustomerLableController extends BaseController {

    /**
     * 添加标签（旧）
     *
     * @param request
     * @return
     */
    @PostMapping("addLable")
    public ResultModel<Long> addLable(@RequestBody CompanyCustomerLableRequest request) {
        return companyCustomerLableService.addLable(request);
    }

    /**
     * 添加标签（新-3.2版本迭代）
     *
     * @param request
     * @return
     */
    @PostMapping("addLableList")
    public ResultModel<Boolean> addLableList(@RequestBody CompanyCustomerLableRequest request) {
        return companyCustomerLableService.addLableList(request);
    }

    /**
     * 删除标签
     *
     * @param request
     * @return
     */
    @PostMapping("delLable")
    public  ResultModel<Boolean> delLable(@RequestBody CompanyCustomerLableRequest request) {
        return companyCustomerLableService.delLable(request);
    }

    /**
     * 获取客户标签树
     *
     * @param request
     * @return
     */
    @PostMapping("getTree")
    public  ResultModel<List<CompanyCustomerLableResponse>> getTree(@RequestBody CompanyCustomerLableRequest request) {
        return companyCustomerLableService.getTree(request);
    }

    /**
     * 修改标签
     *
     * @param request
     * @return
     */
    @PostMapping("updLable")
    public  ResultModel<Boolean> updLable(@RequestBody CompanyCustomerLableRequest request) {
        return companyCustomerLableService.updLable(request);
    }
}
